<!DOCTYPE html>
<html lang="ch">
<head>
    <meta charset="UTF-8">
    <title>Search</title>
    <link rel="stylesheet" type="text/css" href="/static/css/bootstrap.min.css">
    <style>
        .container {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 500px;
        }

        .container input[type="text"] {
            width: 800px;
            padding: 10px;
        }
    </style>
</head>
<body>
{% block navbar %}
    <div class="navbar navbar-inverse" role="navigation">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle"
                        data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">Flasky</a>
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li><a href="/">Home</a></li>
                </ul>
            </div>
        </div>
    </div>
{% endblock %}
<h1 style="text-align: center;">fancymeng</h1>
<form method="POST">
    <div class="container">
        <input type="text" class="text" name="query" placeholder="Enter your query">
        <a id="submit" href="/data" class="btn btn-primary" role="button">搜索</a>
    </div>
</form>
<script>
    document.getElementById('submit').addEventListener('click', function () {
        var query = document.getElementsByName('query')[0].value;
        this.href = '/data?query=' + query;
    });
</script>
</body>
</html>
